Skip to content

refactor(@angular/cli): migrate MCP server to @modelcontextprotocol/server v2 - #33737

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:mcp-sdk-v2-migration
Aug 4, 2026
Merged

refactor(@angular/cli): migrate MCP server to @modelcontextprotocol/server v2#33737
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:mcp-sdk-v2-migration

Conversation

@clydin

@clydin clydin commented Aug 4, 2026

Copy link
Copy Markdown
Member

Upgrades the Model Context Protocol (MCP) server implementation from @modelcontextprotocol/sdk v1.30.0 to the role-specific @modelcontextprotocol/server v2.0.0 package. The monolithic SDK dependency has been replaced in both package.json and BUILD.bazel, with StdioServerTransport now resolved from the @modelcontextprotocol/server/stdio subpath.

In the MCP server initialization, notification handler registration for roots list changes now uses the spec method string instead of a Zod schema object. Additionally, tool-registry.ts introduces McpToolCallback and centrally wraps raw Zod schemas with z.object() during tool registration so individual tool declarations do not require schema syntax changes. Finally, low-level handlers in the zoneless migration tool have been updated to use ServerContext in place of RequestHandlerExtra, routing notifications and sampling requests through ctx.mcpReq.log and ctx.mcpReq.send.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Aug 4, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the Angular CLI MCP implementation from @modelcontextprotocol/sdk to the new @modelcontextprotocol/server package (v2.0.0). This involves updating imports, replacing RequestHandlerExtra with ServerContext, adapting logging and request sending to use the new mcpReq context API, and updating tool registration schemas. Feedback on the changes highlights that the MCP specification does not support outputSchema or title in tool registration, which can trigger TypeScript excess property checking errors or runtime issues; it is recommended to destructure these properties out before registering tools.

Comment thread packages/angular/cli/src/commands/mcp/tools/tool-registry.ts
…erver v2

Upgrades the Model Context Protocol (MCP) server implementation from @modelcontextprotocol/sdk v1.30.0 to the role-specific @modelcontextprotocol/server v2.0.0 package. The monolithic SDK dependency has been replaced in both package.json and BUILD.bazel, with StdioServerTransport now resolved from the @modelcontextprotocol/server/stdio subpath.

In the MCP server initialization, notification handler registration for roots list changes now uses the spec method string instead of a Zod schema object. Additionally, tool-registry.ts introduces McpToolCallback and centrally wraps raw Zod schemas with z.object() during tool registration so individual tool declarations do not require schema syntax changes. Finally, low-level handlers in the zoneless migration tool have been updated to use ServerContext in place of RequestHandlerExtra, routing notifications and sampling requests through ctx.mcpReq.log and ctx.mcpReq.send.
@clydin
clydin force-pushed the mcp-sdk-v2-migration branch from a806240 to bffd856 Compare August 4, 2026 02:20
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Aug 4, 2026
@clydin
clydin requested a review from alan-agius4 August 4, 2026 02:21
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 4, 2026
@alan-agius4
alan-agius4 merged commit b81b880 into angular:main Aug 4, 2026
41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

@clydin
clydin deleted the mcp-sdk-v2-migration branch August 4, 2026 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/cli target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants